<template>
  <div class="dance">
  <text1></text1>
  <text2></text2>
  <text3></text3>
  <text4></text4>
  <shop></shop>
  <dancebottom></dancebottom>
  </div>
</template>

<script>
import text1 from './components/text1.vue'
import text2 from './components/text2.vue'
import text3 from'./components/text3.vue'
import text4 from './components/text4.vue'
import shop from './components/shop.vue'
import dancebottom from './components/dancebottom.vue'

export default {
  name:'dance',
  components:{
    text1,
    text2,
    text3,
    text4,
    shop,
    dancebottom
  },
 data: function(){
    return{
      iconList: [],
      recommendList: []
    }
  },
  mounted(){
    this.getHomeApiInfo()
  },
  methods: {
    getHomeApiInfo(){
      axios.get("/mock/beauty.json").then(this.getHomeResponseInfo)
    },
    getHomeResponseInfo(response){
      //  console.log(response.data);
      let res = response.data  //就是home.json里面的内容
      if(res.success && res.dataList){
        const data = res.dataList //取json中的datalist属性
        // console.log(data.iconLists.length)
        this.iconList = data.iconLists
        this.recommendList = data.recommendLists
      }
    }
  }

   
}

</script>